import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

import Layout from '@/views/layout'
import Login from '@/views/login'
import Resgister from '@/views/register'
import Details from '@/views/detail'

import Article from '@/views/article'
import Collect from '@/views/collect'
import Like from '@/views/like'
import User from '@/views/user'

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      redirect:'/article',
      children: [
        { path: '/article', component: Article },
        { path: '/collect', component: Collect },
        { path: '/like', component: Like },
        { path: '/user', component: User },
      ]
    },
    { path: '/login', component: Login },
    { path: '/register', component: Resgister },
    { path: '/detail/:id', component: Details },

  ]
})

export default router
